import axios from 'utils/axios';

// 获取文章列表
export const getArticles = (params) =>
	axios({ url: '/v1_0/mp/articles', method: 'get', params });

// 发布文章
export const issueArticle = (data, draft = false) =>
	axios.post('/v1_0/mp/articles?draft=' + draft, data);

// 删除文章
export const delArticle = (id) => axios.delete(`/v1_0/mp/articles/${id}`);

// 获取文章详情
export const getArticleById = (id) => axios.get(`/v1_0/mp/articles/${id}`);

// 编辑文章
export const putArtcileById = (data) =>
	axios.put(`/v1_0/mp/articles/${data.id}`, data);
